//
//  VideoCollectionViewCell.m
//  LOL_PalmarHelper
//
//  Created by dllo on 15/6/19.
//  Copyright (c) 2015年 hantao. All rights reserved.
//

#import "VideoCollectionViewCell.h"

@implementation VideoCollectionViewCell

- (void)dealloc
{
    [_imageview1 release];
    [_label1 release];
    [_VideoData release];
    [super dealloc];
}

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    
    if (self) {
        [self createSubView];
    }
    return self;
}


- (void)createSubView
{

//    图片
     self.imageview1 = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 80, 80)];
    
    [self.contentView addSubview:self.imageview1];
    
    [_imageview1 release];
//    文字
    self.label1 = [[UILabel alloc] initWithFrame:CGRectMake(0, 80, 80, 20)];
    
    [self.contentView addSubview:self.label1];
//    字体大小
    self.label1.font = [UIFont systemFontOfSize:13];
    
    self.label1.lineBreakMode = NSLineBreakByWordWrapping;
    
    self.label1.numberOfLines = 0;
    
    [_label1 release];
    
    
}

-(void)setVideoData:(VideoModel *)VideoData
{
 
    if (_VideoData != VideoData) {
        [_VideoData release];
        _VideoData = [VideoData retain];
    }
    NSString *str = self.VideoData.icon;
    
    NSURL *url = [NSURL URLWithString:str];
    
    
    [self.imageview1 sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"80.jpg"]];
    
    self.label1.text = self.VideoData.name;
    
    self.label1.textAlignment = NSTextAlignmentCenter;
    
    
}




























@end
